class Solution {
    public:
        void moveZeroes(vector<int>& nums) {
            int lastindex=0;
            for(int fastindex=0;fastindex<nums.size();fastindex++){
                if(nums[fastindex]!=0){
                    nums[lastindex++]=nums[fastindex];
                }
            }
            for(int i=lastindex;i<nums.size();i++){
                nums[i]=0;
            }
        }
    };